package org.qqcui.designpattern.patterns.visitor;

/**
 * 访问者模式客户端
 *
 * @author cuiqingqiang
 * @version 1.0
 * @date 2022/5/6 13:52
 **/
public class Client {

    public static void main(String[] args) {
        // 创建ObjectStructure
        ObjectStructure objectStructure = new ObjectStructure();
        objectStructure.attach(new Man());
        objectStructure.attach(new Woman());
        // 成功访问者
        Success success = new Success();
        objectStructure.display(success);
        // 失败访问者
        Fail fail = new Fail();
        objectStructure.display(fail);
    }
}
